<?php

/**
 * ProduitSimple filter form base class.
 *
 * @package    ProjetBar
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BaseProduitSimpleFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'quantite_stock'  => new sfWidgetFormFilterInput(),
      'seuil_stock'     => new sfWidgetFormFilterInput(),
      'libelle_produit' => new sfWidgetFormFilterInput(),
      'image_produit'   => new sfWidgetFormFilterInput(),
    ));

    $this->setValidators(array(
      'quantite_stock'  => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'seuil_stock'     => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'libelle_produit' => new sfValidatorPass(array('required' => false)),
      'image_produit'   => new sfValidatorPass(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('produit_simple_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'ProduitSimple';
  }

  public function getFields()
  {
    return array(
      'id_produit'      => 'Number',
      'quantite_stock'  => 'Number',
      'seuil_stock'     => 'Number',
      'libelle_produit' => 'Text',
      'image_produit'   => 'Text',
    );
  }
}
